
const common={
    toast:function(status,msg){
        let div=document.createElement('div');
        div.className='toast';
        let msg1=`
            <div class="icon">
                 ${status?'√':'!'}
            </div>
            <div class="msg">
                ${msg}
            </div>        
        `;
        div.innerHTML=msg1;
        document.body.appendChild(div);
        setTimeout(function(){
            div.remove();
        },1000)
    },
    creatfooter:function(page){
        let footer=document.createElement('footer');
        footer.className='footer';
        footer.innerHTML=`
        <a href="index.html" class="${page=='index'?'active':''}">
            <p><span class="iconfont icon-ziyuan"></span>首页</p>
        </a>
        <a href="training_course.html" class="${page=='run'?'active':''}">
            <p><span class="iconfont icon-xintiao"></span>运动</p> 
        </a>
        <a href="my.html" class="${page=='my'?'active':''}">
            <p><span class="iconfont icon-wode"></span>我的</p>
        </a>
        `;
        document.body.appendChild(footer);
    }
}
window.common=common;

